package com.kyzh.core.pager.weal.recover

import android.app.Activity
import android.content.Intent
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import com.kyzh.core.R
import com.kyzh.core.current.WealImpl1.WealImpl1
import kotlinx.android.synthetic.main.activity_che_xiao.*

class CheXiaoActivity : AppCompatActivity() {
    companion object{
        @JvmStatic
        fun start(context: Activity,id : String) {
            val starter = Intent(context, CheXiaoActivity::class.java)
                .putExtra("id",id)
            context.startActivityForResult(starter,10010)
        }
    }
    private var id :String= ""
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_che_xiao)
        id = intent.getStringExtra("id")
        initView()

    }
    fun initView(){
        tvSubmit.setOnClickListener {
            tvSubmit.isEnabled = false
            WealImpl1.chexiao(id,edt.text.toString().trim()){
                if(this){
                    finish()
                }else{
                    tvSubmit.isEnabled = true
                }
            }
        }
        close.setOnClickListener {
            finish()
        }
    }
}